﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ES.Admin
{
    public partial class SatisDetay : Form
    {
        public SatisDetay()
        {
            InitializeComponent();
        }
        public int Id { get; set; }
        private Sale Sale { get; set; }
        private void SatisDetay_Load(object sender, EventArgs e)
        {
            Sale = Program.Db.Sales.SingleOrDefault(d => d.Id == Id);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SetValue(1);
        }

        private void SetValue(short sayi)
        {
            Sale.SaleState = sayi;
            Program.Db.SubmitChanges();
            Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SetValue(2);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SetValue(3);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            SetValue(5);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            SetValue(4);
        }
    }
}
